﻿namespace HazeCore.Persistence
{
    public interface IBinaryPersistable
    {
        #region Properties

        #region Classwide properties
        // These implies the implementing class should provide a lightweighted constructor for instantiate a temporary
        // object for calls on them

        bool IsFixedSized { get; }
        uint TypeId { get; }

        #endregion

        #region Instance specific properties

        /// <summary>
        ///  The current size of the object 
        ///  Should always return the size if it's a fixed-sized object
        /// </summary>
        int Size { get; }

        #endregion

        #endregion

        void SaveToBuffer(byte[] buffer);
        void LoadFromPersister(IBinaryPersister persister);
    }
}
